﻿namespace SLClient.CustomerControls
{
    using SLClient.Infrastructure;
    using System;
    using System.Linq.Expressions;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Windows.Input;

    public class SearchUserViewModel : ViewModelBase
    {
        private string _searchText;

        public SearchUserViewModel()
        {
            this.CommandInit();
        }

        public void CommandInit()
        {
            RelayCommand command = new RelayCommand(new Action(this.Search)) {
                IsEnabled = true
            };
            this.SearchCommand = command;
        }

        public void Search()
        {
            if (string.IsNullOrEmpty(this.SearchText))
            {
            }
        }

        public ICommand SearchCommand { get; set; }

        public string SearchText
        {
            get
            {
                return this._searchText;
            }
            set
            {
                this._searchText = value;
                base.Notify<string>(() => this.SearchText);
                //base.Notify<string>(System.Linq.Expressions.Expression.Lambda<Func<string>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(SearchUserViewModel)), (MethodInfo)(SearchUserViewModel.get_SearchText)), new ParameterExpression[0]));
            }
        }
    }
}

